<!--幻灯片组件-->
<template>
  <el-carousel height="230px">
    <el-carousel-item v-for="item in carouselData" :key="item.src">
      <img :src="item.src" class="carousel-img-sty">
    </el-carousel-item>
  </el-carousel>
</template>

<script>
  export default {
    name: 'carousel',
    props: {
      carouselData: {
        type: Array,
        default: []
      }
    },
    data () {
      return {}
    },
    mounted(){
      console.log(this.carouselData);
    }
  }
</script>

<style scoped>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
    text-align: center;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #fff;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #fff;
  }

  .carousel-img-sty {
    height: 100%;
    width: 100%;
  }
</style>
